<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../ext/resources/css/ext-all.css"
	type="text/css"></link>
<script type="text/javascript" src="../ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../ext/ext-all.js"></script>
<script type="text/javascript" src="../js/userAppJsp.js"></script>
<script type="text/javascript">
Ext.onReady(function() {
	Ext.QuickTips.init();
});
function applyExam(exam_state, exam_Id, startTime, endTime) {
	if (exam_state != 0) {
		Ext.Msg.show({
			title : '提示',
			msg : '对不起,该考试已经停止了报名,感谢您的关注！',
			buttons : Ext.MessageBox.OK,
			icon : Ext.MessageBox.INFO
		});
	} else {
		Ext.Ajax
				.request({
					url : '../examinee/validateUserExam.action',
					method : 'post',
					params : {
						exam_Id : exam_Id,
						startTime : startTime,
						endTime : endTime,
						status:1
					},
					success : function(response) {
						var obj = Ext.decode(response.responseText);
						if (obj.success == false) {
							Ext.Msg.show({
								title : '错误提示',
								msg : obj.msg,
								buttons : Ext.MessageBox.OK,
								icon : Ext.MessageBox.WARNING
							});
						} else {
							window.location.href = "../examinee/toApplyFormPage.action?exam_Id="
									+ exam_Id;
						}
					},
					failure : function(response) {
						Ext.Msg.alert("错误", "服务器连接失败！");
					}
				});
	}
}
</script>
</head>
<body>
	<div class="right1">
		<div class="bar3">
			<b>考试信息查询列表</b>
			<div class="jslx">
				<font color="#A2A2A2" size="3">一共分为${pageCount}页，当前页为${pageNow}页</font>
				<div class="clear"></div>
			</div>
		</div>
		<s:if test="exams==null">
		<h1 align="center">无查询数据......</h1>
		</s:if>
		<s:else>
			<ul class="list2">
				<li class="t_bg"><span class="N0">编 号</span><span class="N3">考试名称</span><span
					class="N0">报名费用</span><span class="N2">考试时间</span><span class="N0">详情</span><span
					class="N0">报名</span></li>
				<s:iterator step="1" status="state" var="exam" value="exams">
					<li class="bg1"><span class="N0"><s:property
								value="#state.index+1" /> </span><span class="N3"
						style="width: 200px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis">${exam.examInfo_Name}</span><span
						class="N0">${exam.examInfo_Money}元</span><span class="N2">${exam.examInfo_StartTime}</span><span
						class="N0"><input type="button" value=" 详 情 "
							onclick="showInfo('${exam.examInfo_Name}','${exam.examInfo_Money}','${exam.examInfo_StartTime}','${exam.examInfo_EndTime}','${exam.examInfo_Comments}','${exam.examInfo_Type.small_Id}','${exam.examInfo_Photo.photo_Name}')" />
					</span><span class="N0"><input type="button" value=" 报 名 "
							onclick="applyExam('${exam.examInfo_State}','${exam.examInfo_Id}','${exam.examInfo_StartTime}','${exam.examInfo_EndTime}')" />
					</span></li>
				</s:iterator>
			</ul>
			<div class="clear"></div>
			<div class="more2">
				<a href="searchExamWithConditions?pageNow=1&small_Id=${small_Id}&exam_Year=${exam_Year}&examName_State=1&exam_status=${exam_status}"><img
					src="../img/more1.jpg" /> </a><a
					href="searchExamWithConditions?pageNow=${pageNow-1}&small_Id=${small_Id}&exam_Year=${exam_Year}&examName_State=1&exam_status=${exam_status}"><img
					src="../img/more2.jpg" /> </a>
				<s:iterator value="new int[pageCount]" status="i">
					<s:if test="#i.index+1>10"></s:if>
					<s:else>
						<a
							href="searchExamWithConditions?pageNow=<s:property value="#i.index+1"  />&small_Id=${small_Id}&exam_Year=${exam_Year}&examName_State=1&exam_status=${exam_status}"><s:property
								value="#i.index+1" /> </a>
					</s:else>
				</s:iterator>
				<a href="searchExamWithConditions?pageNow=${pageNow+1}&small_Id=${small_Id}&exam_Year=${exam_Year}&examName_State=1&exam_status=${exam_status}"><img
					src="../img/more3.jpg" /> </a><a
					href="searchExamWithConditions?pageNow=${pageCount}&small_Id=${small_Id}&exam_Year=${exam_Year}&examName_State=1&exam_status=${exam_status}"><img
					src="../img/more4.jpg" /> </a>
			</div>
		</s:else>
	</div>
</body>
</html>